<template>
  <div>
    <!-- 优惠券类型 -->
    <a-tag>{{ CouponTypeEnum[text].name }}</a-tag>
    <!-- 最低消费金额 -->
    <p class="c-p">{{ text }}</p>
    <!-- 优惠方式 -->
    <template slot="discount" slot-scope="item">
      <template v-if="item.coupon_type == 10">
        <span>立减</span>
        <span class="c-p mlr-2">{{ item.reduce_price }}</span>
        <span>元</span>
      </template>
      <template v-if="item.coupon_type == 20">
        <span>打</span>
        <span class="c-p mlr-2">{{ item.discount }}</span>
        <span>折</span>
      </template>
    </template>
    <!-- 有效期 -->
    <template v-if="goods.expire_type == 10">
      <span>领取</span>
      <span class="c-p mlr-2">{{ goods.expire_day }}</span>
      <span>天内有效</span>
    </template>
    <template v-if="goods.expire_type == 20">
      <span>{{ goods.start_time }} ~ {{ goods.end_time }}</span>
    </template>
  </div>
</template>

<script>
// import PropTypes from 'ant-design-vue/es/_util/vue-types'
import { ApplyRangeEnum, CouponTypeEnum, ExpireTypeEnum } from '@/common/enum/coupon'
// Table内容元素: 商品信息
export default {
  name: 'CouponsItem',
  data() {
    return {
      CouponTypeEnum,
    }
  },
  props: {
    // 商品信息
    goods: {
      type: Object,
      default: () => {},
    },
    // data: PropTypes.object.def({
    //   image: '',
    //   imageAlt: '',
    //   title: '',
    //   subtitle: '',
    //   goodsProps: []
    // }),
    // // 副标题颜色
    // subTitleColor: PropTypes.bool.def(false)
  },
  methods: {},
}
</script>

<style lang="less" scoped>
@size: 60px;
.goods-info {
  width: 270px;
  line-height: 1.3;
  white-space: normal;
  .in-left {
    float: left;
    margin-right: 8px;

    img {
      width: @size;
      height: @size;
    }
  }
  .in-right {
    display: flex;
    flex-direction: column;
    justify-content: center;
    float: left;
    width: 200px;
    height: @size;
    .title {
      font-size: 13px;
      margin-bottom: 5px;
    }
    .subtitle {
      font-size: 12px;
      color: #7b7b7b;
    }
  }
  // 商品规格

  .goods-props {
    color: #8a8a8a;
    font-size: 12px;
    overflow: hidden;

    &-item {
      display: inline-block;
      margin-right: 4px;
    }
  }
}
</style>
